<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateApartmentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('apartments', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title')->comment('户型名称');
            $table->integer('property_id')->unsigned()->default(0)->comment('楼盘id');
            $table->tinyInteger('room')->unsigned()->default(1)->comment('几室');
            $table->tinyInteger('hall')->unsigned()->default(0)->comment('几厅');
            $table->tinyInteger('toilet')->unsigned()->default(0)->comment('几卫');
            $table->tinyInteger('kitchen')->unsigned()->default(0)->comment('几厨');
            $table->float('acreage')->nullable()->comment('面积');
            $table->float('price')->nullable()->default(0)->comment('价格');
            $table->tinyInteger('category_id')->nullable()->default(0)->comment('朝向');
            $table->string('salestatus')->comment('销售状态');
            $table->string('feature')->nullable()->comment('户型特色');
            $table->text('images')->nullable()->comment('户型图');
            $table->string('status')->default('T')->comment('状态：T 启用 F 禁用');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('apartments');
    }
}
